﻿
using System.Web;

namespace CommonHelper.Common
{
    /// <summary>
    /// Description:Use it for data cathe operation
    /// Created by:lhan
    /// Created:2013/3/29
    /// Last modified by: lhan
    /// Last modified:2013/3/29
    /// Version:1.0.0.0
    /// </summary>
    public class DataCacheHelper
    {
        /// <summary>
        /// 获取当前应用程序指定CacheKey的Cache值
        /// </summary>
        /// <param name="cacheKey"></param>
        /// <returns></returns>
        public static object GetCache(string cacheKey)
        {
            System.Web.Caching.Cache objCache = HttpRuntime.Cache;
            return objCache[cacheKey];
        }

        /// <summary>
        /// 设置当前应用程序指定CacheKey的Cache值
        /// </summary>
        /// <param name="cacheKey"></param>
        /// <param name="objObject"></param>
        public static void SetCache(string cacheKey, object objObject)
        {
            System.Web.Caching.Cache objCache = HttpRuntime.Cache;
            objCache.Insert(cacheKey, objObject);
        }
    }
}
